<template>
 <div class="nav">
   <!-- 导航列表 -->
   <router-link tag="div" class="nav-item"
    v-for="item of navList"
    :to="item.link"
    :key="item.text + Math.random()">
    <!-- 导航项图标 -->
    <span class="nav-item-icon iconfont" :class="[item.icon]"></span>
    <!-- 导航项内容 -->
    <span class="nav-item-tetx">{{ item.text }}</span>
   </router-link>

 </div>
</template>
<script>
export default {
  name: 'navBar',
  data () {
    return {
      navList: [
        {
          icon: '',
          text: '微博',
          link: '/'

        }, {
          icon: 'icon-home',
          text: '首页',
          link: '/'

        }, {
          icon: 'icon-mine',
          text: '我的空间',
          link: '/profile'
        }, {
          icon: 'icon-multiplayer',
          text: '广场',
          link: '/square'
        }, {
          icon: 'icon-setting',
          text: '设置',
          link: '/setting'
        }
      ]
    }
  }
}
</script>
<style lang="scss" scoped>
.nav{
  display: flex;
  flex-wrap: wrap;
  min-height: 60px;
  line-height: 60px;
  padding: 0 20px;
  margin-bottom: 40px;
  font-size: 16px;
  color: #fff;
  background: #007bff;
  &>:first-child{
    font-size: 25px;
  }
  .nav-item{
    margin-right: 15px;
    vertical-align: middle;
    .nav-item-icon{
      margin-right: 5px;
    }
  }
}
</style>
